/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package weixin.popular.message.handler.defaultimpl;

import java.util.concurrent.BlockingQueue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import weixin.popular.bean.message.EventMessage;
import weixin.popular.bean.xmlmessage.XMLMessage;
import weixin.popular.bean.xmlmessage.XMLTextMessage;
import weixin.popular.message.handler.Provider;
import weixin.popular.message.handler.MessageHandler;

/**
 * 取消关注
 *
 * @author 张森
 */
@Provider
public class UnsubscribeMessageHandler implements MessageHandler {

    @Override
    public boolean isSupport(EventMessage message) {
        return message.getMsgType().equals("unsubscribe");
    }

    @Override
    public XMLMessage reply(EventMessage message) {
        XMLMessage xmlTextMessage = new XMLTextMessage(
                message.getFromUserName(),
                message.getToUserName(),
                "你好，欢迎下次关注");
        return xmlTextMessage;
    }
}
